import 'package:equatable/equatable.dart';
import 'package:learning_content_admin_pannel.core/core/domain/entities/learning_content/lexical_item/lexical_item.dart';
import 'package:learning_content_admin_pannel.home.words/single_word_base_page/domain/entities/word_base_input.dart';

part 'result.dart';

abstract class UpdateWordBaseInputCefrLevel {
  WordBaseInputCefrLevelUpdateResult call({
    required CefrLevel wordBaseInputCefrLevel,
    required WordBaseInput wordBaseInput,
  });
}

class UpdateWordBaseInputCefrLevelImpl implements UpdateWordBaseInputCefrLevel {
  const UpdateWordBaseInputCefrLevelImpl();

  @override
  WordBaseInputCefrLevelUpdateResult call({
    required CefrLevel wordBaseInputCefrLevel,
    required WordBaseInput wordBaseInput,
  }) {
    final updatedWordBaseInput = wordBaseInput.copyWith(
      cefrLevel: () => wordBaseInputCefrLevel,
    );

    final result = WordBaseInputCefrLevelUpdateResult(
      wordBaseInput: updatedWordBaseInput,
    );

    return result;
  }
}
